#include <iostream>
#include <list>
#include <vector>
#include <string>
#include <fstream>

#include "generiman.h"

using namespace std;

int main(int argc,char*argv[]){

    list<string> to_search1;
    vector<string> to_search2;

   if (argc!=3){
        cout << "Usage is program <file> word_to_search" << endl;
        return 1;
    }
   int a=5,b=12;
   double x= 12.4,y=23.5;

   cout << normal_topla(a,b) << endl;
   cout << "Integer carpmas var :"<< toplama<int>(a,b)<< endl;
   cout << "Double caprmasi var : "<< toplama<double>(x,y) << endl;

   cout << "sending list" << endl ;
   read_file_content(to_search1,argv[1]);

   cout << "sending vector" << endl;
   read_file_content(to_search2,argv[1]);


   for (vector<string>::size_type i=0; i!=to_search2.size(); i++){
        string::size_type loc = to_search2[i].find(argv[2],0);

        if (loc!=string::npos){
            cout << "The word found on" << i << "line" << "on the " << loc << "position" << endl; 
        }
   }

   //if everything succesful lets try 
   cout << "Every thing is good !" << endl;

   return 0;
}

